import axios from "axios"
import { Dispatch } from "redux"

export let getlist=()=>{
    return async (dispatch:Dispatch)=>{
   let {data}=await axios.get("/api/list")
   dispatch({
    type:'GET_LIST',
    payload:data.list
   })
    }
}

export let add_list=(values:any)=>{
   return {
    type:"ADD_LIST",
    payload:values
   }
}
export let edit_list=(values:any)=>{
    return {
     type:"EDIT_LIST",
     payload:values
    }
 }
